Crate x11rb_protocol

source ·
Expand description

X11 rust bindings.

This crate provides a representation of the X11 protocol in Rust. With this protocol, raw X11 bytes can be parsed into a structured representation or raw bytes can be produces.

This protocol does not do any I/O. If you need an X11 client library, look at https://docs.rs/x11rb/latest/x11rb/.

Feature flags

This crate uses feature flags to reduce the amount of compiled code. There are two kinds of feature flags available:

  • Feature flags for specific X11 extensions
  • Feature flags for additional functionality

Feature flags for specific X11 extensions

By default, only the core X11 protocol and some small, commonly needed X11 extensions are enabled. These are the bigreq, ge and xc_misc extensions. Further extensions need to be explicitly enabled via their feature flag:

composite, damage, dpms, dri2, dri3, glx, present, randr, record, render, res, screensaver, shape, shm, sync, xevie, xf86dri, xf86vidmode, xfixes, xinerama, xinput, xkb, xprint, xselinux, xtest, xv, xvmc.

If you want to take the “I do not want to think about this”-approach, you can enable the all-extensions feature to just enable, well, all extensions.

Feature flags for additional functionality

Additionally, the following flags exist:

  • std (enabled by default): Enable functionality needing the std library, e.g. environment variables or std::os::unix::io::OwnedFd.
  • resource_manager: Enable the code in resource_manager for loading and querying the X11 resource database.
  • serde: Implement serde::Serialize and serde::Deserialize for all objects.
  • request-parsing: Add the ability to parse X11 requests. Not normally needed.
  • extra-traits: Implement extra traits for types. This improves the output of the Debug impl and adds PartialEq, Eq, PartialOrd, Ord, and Hash where possible.

Modules

  • Contains utilities for connection to the X11 server.
  • Helper types for implementing an X11 client.
  • This module contains the current mess that is error handling.
  • A mechanism for allocating XIDs.
  • Collects X11 data into “packets” to be parsed by a display.
  • Utilities for parsing X11 display strings.
  • Bindings to the X11 protocol.
  • X11 resource manager library.
  • Helpers for the generated code
  • Utility functions for X11 things.
  • Helpers for working with ~/.Xauthority.

Enums

  • Variants describing which responses to a request should be discarded.

Type Aliases

  • A combination of a buffer and a list of file descriptors.
  • The raw bytes of an event and its sequence number.
  • A type representative of the file descriptors as they are sent to and from the X server.
  • Number type used for referring to things that were sent to the server in responses from the server.